package com.zxc.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zxc.dao.SysRoleMapper;
import com.zxc.entity.SysRole;
import com.zxc.service.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements SysRoleService {

    @Autowired
    private SysRoleMapper sysRoleMapper;

    @Override
    public SysRole getRoleIdByName(String sysUserRole) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("name",sysUserRole);
        SysRole sysRole = sysRoleMapper.selectOne(queryWrapper);
        return sysRole;
    }
}
